package com.smooth.site.sx.pc.base.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smooth.common.site.common.rsp.ReturnResult;
import com.smooth.dao.gen.BaseCategoryMapper;
import com.smooth.dao.gen.bean.BaseCategory;
import com.smooth.dao.gen.bean.BaseCategoryExample;

@Controller
@RequestMapping(value = "/pc")
public class PcCategoryController {
	@Autowired
	BaseCategoryMapper baseCategoryMapper;
	/**
	 * 学生注册
	 * @param studenRegVo
	 * @param result
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = {"p/basedata/category/query"},method = {RequestMethod.POST,RequestMethod.GET})
	@ResponseBody
	public ReturnResult register(@RequestParam(required=true) Integer categoryType,HttpServletRequest request, HttpServletResponse response) {
		ReturnResult returnResult = new ReturnResult();
		
		BaseCategoryExample baseCategoryExample = new BaseCategoryExample();
		BaseCategoryExample.Criteria criteria = baseCategoryExample.createCriteria();
		
		criteria.andCategoryTypeEqualTo(categoryType);
		
		List<BaseCategory> blist = baseCategoryMapper.selectByExample(baseCategoryExample);
		returnResult.setData(blist);
		return returnResult;
	}
	
	
	
	
}
